package com.example.InnerClass;

public class Test4Innerclass {
    public static void main(String[] args) {
        interTmpl ii = new interTmpl();
        ii.show();

        new Inter() {

            @Override
            public void show() {
                System.out.println("内部类的show方法");
            }
        }.show();

        // 接口中存在多个方法
        Inter2 i = new Inter2() {

            @Override
            public void show1() {
                System.out.println("show1");
            }

            @Override
            public void show2() {
                System.out.println("show2");
            }
        };
        i.show1();
        i.show2();

    }
}

interface Inter {
    void show();
}

interface Inter2 {
    void show1();
    void show2();
}

class interTmpl implements Inter {

    @Override
    public void show() {
        System.out.println("interTmpl 重写的show方法");
    }
}